package cn.com.generaldata.jsme_indicator_system.entity;

import java.sql.Timestamp;

import lombok.Data;

import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;

/**
 * 核算指标引用指标表.
 */
@Data
@Table("t_indicator_accounting_ref")
public class IndicatorAccountingReference implements java.io.Serializable {

	private static final long serialVersionUID = 4263403298674508811L;

	// columns START
	/**
	 * 主键 db_column: id
	 */
	@Id
	@Column("id")
	private Integer id;
	/**
	 * 核算指标id db_column: indicator_accounting_id
	 */
	@Column("indicator_accounting_id")
	private Integer indicatorAccountingId;
	/**
	 * 引用指标id db_column: reference_indicator_id
	 */
	@Column("reference_indicator_id")
	private Integer referenceIndicatorId;
	/**
	 * 引用指标类型 db_column: reference_indicator_type
	 */
	@Column("reference_indicator_type")
	private Integer referenceIndicatorType;
	/**
	 * 指标取值方式 db_column: get_value_type
	 */
	@Column("get_value_type")
	private Integer getValueType;
	/**
	 * 时期 db_column: phase
	 */
	@Column("phase")
	private Integer phase;
	/**
	 * 公式中变量名称 db_column: formula_name
	 */
	@Column("formula_name")
	private String formulaName;
	/**
	 * 创建时间 db_column: create_time
	 */
	@Column("create_time")
	@ColDefine(update = false)
	private java.sql.Timestamp createTime = new Timestamp(System.currentTimeMillis());
	/**
	 * 最后修改时间 db_column: last_update
	 */
	@Column("last_update")
	@ColDefine(update = true)
	private java.sql.Timestamp lastUpdate = new Timestamp(System.currentTimeMillis());
	// columns END

	private String indicatorName;

	private String indicatorCode;

	private Integer indicatorFrequency;

	private String indicatorUnit;

	private Integer section;

	public String getReferenceIndicator() {
		return String.format("%s_%s_%s", referenceIndicatorType, referenceIndicatorId, getValueType);
	}

}
